﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.Coolzon.UI.DataPartLib
{
    /// <summary>
    /// 条件控件工厂
    /// </summary>
    [Obsolete("请使用多参数的重载")]
    public static class ConditionControlFactory
    {
        public static ConditionControl Create(
            string name,
            UI.Part part,
            Script.DataSeriesScriptObject dataSeries,
            ServiceProxy.DataServiceRef.DataItem dataItem)
        {
            string nameUpper = name.ToUpper();

            if (nameUpper == "CONDITIONIMAGE")
            {
                ConditionControl control = new ConditionImage();
                control.Init(part, dataSeries, dataItem);

                return control;
            }

            return null;
        }

        public static ConditionControl Create(
            UI.Part ownerPart,
            ServiceProxy.DataServiceRef.DataResult dataResult,
            ServiceProxy.DataServiceRef.DataSeries dataSeries,
            ServiceProxy.DataServiceRef.DataItem dataItem)
        {
            ConditionImage control = new ConditionImage();
            control.Init(ownerPart, dataResult, dataSeries, dataItem);
            return control;
        }
    }
}
